package com.gitee.wsl.ext.coroutines

import com.gitee.wsl.api.Closeable
import kotlinx.coroutines.CloseableCoroutineDispatcher
import kotlinx.coroutines.CoroutineDispatcher

@Suppress("OPT_IN_USAGE")
fun CoroutineDispatcher.close() {
    when (this) {
        is Closeable -> this.close()
        is CloseableCoroutineDispatcher -> this.close()
    }
}

